package com.jpc.musicdelightapplication.data

import com.jpc.lib_base.data.bean.ApiResponse
import com.jpc.lib_base.http.RetrofitManager
import com.jpc.musicdelightapplication.data.bean.BannerData
import com.jpc.musicdelightapplication.data.bean.BannerListData
import com.jpc.musicdelightapplication.data.bean.PlaylistData
import com.jpc.musicdelightapplication.data.bean.PlaylistTagData
import com.jpc.musicdelightapplication.data.bean.QrCodeKeyData
import com.jpc.musicdelightapplication.data.bean.SongData
import com.jpc.musicdelightapplication.data.http.Api

object DataRepository: Api{
    private val service by lazy { RetrofitManager.getService(Api::class.java) }

//    override suspend fun getQrCodeKey(): ApiResponse<QrCodeKeyData> {
//        return service.getQrCodeKey()
//    }

    override suspend fun getBanner(): ApiResponse<List<BannerData>> {
        return service.getBanner()
    }

    override suspend fun getRankingList(): ApiResponse<List<PlaylistData>> {
        return service.getRankingList()
    }

    override suspend fun getPlaylistTagList(): ApiResponse<List<PlaylistTagData>> {
        return service.getPlaylistTagList()
    }

    override suspend fun getPlaylistList(
        cat: String,
        limit: Int,
        offset: Int
    ): ApiResponse<List<PlaylistData>> {
        return service.getPlaylistList(cat, limit, offset)
    }

    override suspend fun getPlaylistDetail(id: Long): ApiResponse<PlaylistData> {
        return service.getPlaylistDetail(id)
    }

    override suspend fun getPlaylistSongList(
        id: Long,
        limit: Int?,
        offset: Int?,
        timestamp: Long?
    ): ApiResponse<List<SongData>> {
        return service.getPlaylistSongList(id, limit, offset, timestamp)
    }
}